import 'package:backend.core/core/domain/entities/google_play/google_play_purchased_item_acknowledgement_status.dart';
import 'package:backend.core/core/domain/entities/google_play/google_play_purchased_item_info.dart';
import 'package:backend.core/core/domain/entities/google_play/google_play_purchased_subscription_info_cancellation_info.dart';
import 'package:backend.core/core/domain/entities/google_play/google_play_purchased_subscription_info_pause_info.dart';
import 'package:backend.core/core/domain/entities/google_play/google_play_purchased_subscription_info_price_change_status.dart';
import 'package:equatable/equatable.dart';

class GooglePlayPurchasedSubscriptionInfo extends Equatable implements GooglePlayPurchasedItemInfo {
  const GooglePlayPurchasedSubscriptionInfo({
    required this.purchaseItemSku,
    required this.purchaseToken,
    required this.googlePlayUserId,
    required this.test,
    required this.startTime,
    required this.autoRenewalEnabled,
    required this.acknowledgementStatus,
    required this.priceChangeStatus,
    required this.cancellationInfo,
    required this.pauseInfo,
  });

  @override
  final String purchaseItemSku;

  @override
  final String purchaseToken;

  @override
  final String googlePlayUserId;

  @override
  final bool test;

  @override
  final GooglePlayPurchasedItemAcknowledgementStatus acknowledgementStatus;

  final DateTime startTime;
  final bool autoRenewalEnabled;
  final GooglePlayPurchasedSubscriptionInfoPriceChangeStatus priceChangeStatus;
  final GooglePlayPurchasedSubscriptionInfoCancellationInfo? cancellationInfo;
  final GooglePlayPurchasedSubscriptionInfoPauseInfo? pauseInfo;

  @override
  List<Object?> get props {
    return [
      purchaseItemSku,
      purchaseToken,
      googlePlayUserId,
      test,
      startTime,
      autoRenewalEnabled,
      acknowledgementStatus,
      priceChangeStatus,
      cancellationInfo,
      pauseInfo,
    ];
  }

  GooglePlayPurchasedSubscriptionInfo copyWith({
    String Function()? purchaseItemSku,
    String Function()? purchaseToken,
    String Function()? googlePlayUserId,
    bool Function()? test,
    DateTime Function()? startTime,
    bool Function()? autoRenewalEnabled,
    GooglePlayPurchasedItemAcknowledgementStatus Function()? acknowledgementStatus,
    GooglePlayPurchasedSubscriptionInfoPriceChangeStatus Function()? priceChangeStatus,
    GooglePlayPurchasedSubscriptionInfoCancellationInfo? Function()? cancellationInfo,
    GooglePlayPurchasedSubscriptionInfoPauseInfo? Function()? pauseInfo,
  }) {
    return GooglePlayPurchasedSubscriptionInfo(
      purchaseItemSku: purchaseItemSku == null ? this.purchaseItemSku : purchaseItemSku(),
      purchaseToken: purchaseToken == null ? this.purchaseToken : purchaseToken(),
      googlePlayUserId: googlePlayUserId == null ? this.googlePlayUserId : googlePlayUserId(),
      test: test == null ? this.test : test(),
      startTime: startTime == null ? this.startTime : startTime(),
      autoRenewalEnabled:
          autoRenewalEnabled == null ? this.autoRenewalEnabled : autoRenewalEnabled(),
      acknowledgementStatus:
          acknowledgementStatus == null ? this.acknowledgementStatus : acknowledgementStatus(),
      priceChangeStatus: priceChangeStatus == null ? this.priceChangeStatus : priceChangeStatus(),
      cancellationInfo: cancellationInfo == null ? this.cancellationInfo : cancellationInfo(),
      pauseInfo: pauseInfo == null ? this.pauseInfo : pauseInfo(),
    );
  }
}
